//
//  SimpleMapViewViewController.h
//  SimpleMapView
//
//  Created by Stefan Ivanov on 10/11/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <MapKit/Mapkit.h>
#import <CoreLocation/CoreLocation.h>
#import <AudioToolbox/AudioToolbox.h>
#import "BarView.h"
#import "CheckPoint.h"
#import "NetworkMessageCreator.h"
#import "NetworkingCenter.h"
#import "CheckpointCaptureView.h"

@interface RunnerController : UIViewController <CLLocationManagerDelegate,MKAnnotation,UIGestureRecognizerDelegate> {
    MKMapView *mapView;
    CLLocationManager *locManager;
    
    //location and heading info variables
    CLLocationDirection heading;
    CLLocation *currentLocation;
    
    //a bar for the top screen information about amount of poins etc.
    BarView *bar;
    
    //alert view when being hunted down by a hunter
    UIView *redView;
    
    //a variabe used to set the zooming level only the first time we get location update after a map view appears
    BOOL isFirstLocationUpdate;
    
    //a variable used to check if it's the first message and only then set the points
    BOOL isFirstMessageFromServer;
    
    //the checkpoint currently available
    CheckPoint *availableCheckpoint;
    
    //a bar at the bootom for catching a checkpoint
    CheckpointCaptureView *checkpointCaptureView;
    
}

@property (nonatomic,retain) IBOutlet MKMapView *mapView;
@property (nonatomic,retain) CLLocationManager *locManager;
@property (assign) CLLocationDirection heading;
@property (nonatomic, retain) CLLocation *currentLocation;
@property (nonatomic, retain) BarView *bar;
@property (nonatomic, retain) UIView *redView;
@property (assign) BOOL isFirstLocationUpdate;
@property (assign) BOOL isFirstMessageFromServer;
@property (nonatomic, retain) CheckPoint *availableCheckpoint;
@property (nonatomic, retain) CheckpointCaptureView *checkpointCaptureView;
@property (assign)int currentTeam;

- (IBAction)collected:(id)sender;
- (void)huntedDown:(id)sender;
- (IBAction)safe:(id)sender;
- (void)startCapturingCP:(id)sender;
- (void)cancelCapturingCP:(id)sender;
- (void)collectOrCancel:(id)sender;
- (void)changePoints:(int)points;
- (void)alertAboutNearbyHunter:(id)sender;
- (void)informAboutBeenCaught:(id)sender;
-(void)handleZooming:(UIGestureRecognizer *)gestureRecognizer;

@end
